﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BookStore
{

    public partial class FrmMain : Form
    {
        Byte startos = 0;
        public FrmMain()
        {
            InitializeComponent();
        }

        private void LExit_Click_1(object sender, EventArgs e)
        {
            DialogResult r = MessageBox.Show("Exit?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
            if (r == DialogResult.Yes)
            {
                Application.Exit();
            }
            else
            {
                r = DialogResult.Cancel;
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            startos++;
            progressBar1.Value = startos;
            LProcess.Text = "加载中.." + startos + "%";
            if(progressBar1.Value == 100)
            {
                progressBar1.Value = 0;
                timer1.Stop();
                FrmLogin frmLogin = new FrmLogin();
                frmLogin.ShowDialog();
                this.Close();
            }
            
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
            timer1.Start();
        }
    }
}
